package com.neu.servlet.klz;

import com.alibaba.fastjson.JSONObject;
import com.neu.service.klz.EventDaoService;
import com.neu.service.klz.KindDaoService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import java.util.Map;

@WebServlet(name = "HuoQuBiaoShiServlet", urlPatterns = {"/HuoQuBiaoShiServlet.do"})
public class HuoQuBiaoShiServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=UTF-8");
        EventDaoService eventDaoService=new EventDaoService();
        List<Map<String,Object>>list=eventDaoService.dofindByEname();
        String json=JSONObject.toJSONString(list);
        PrintWriter out=response.getWriter();
        out.write(json);
        out.close();
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }
}
